package com.mycom.service.impl;

import com.mycom.controller.constant.Code;
import com.mycom.dao.UserDao;
import com.mycom.exception.BusinessException;
import com.mycom.exception.SystemException;
import com.mycom.pojo.User;
import com.mycom.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public boolean save(User user) {
        userDao.save(user);
        return true;
    }

    @Override
    public boolean update(User user) {
        userDao.update(user);
        return true;
    }

    @Override
    public boolean delete(Integer id) {
        userDao.delete(id);
        return true;
    }

    @Override
    public User findById(Integer id) {
        return userDao.findById(id);
    }

    @Override
    public List<User> selectAll() {
        return userDao.selectAll();
    }
}
